package com.yunji.product.service.impl;

import com.yunji.product.bo.AttrListQueryBO;
import com.yunji.product.dao.IProductAttrDao;
import com.yunji.product.domain.AttrDO;
import com.yunji.product.service.IProductAttrService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Arrays;
import java.util.List;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.product.service.impl
 * @Title: ProductAttrServiceImpl
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-14 10:55:26      V1.0        HuaAo       新建类
 */
@Service
public class ProductAttrServiceImpl implements IProductAttrService {

    @Resource
    IProductAttrDao productAttrDao;

    @Override
    public boolean create(AttrDO attr) {
        return productAttrDao.save(attr);
    }

    @Override
    public List<AttrDO> search(AttrListQueryBO bo) {
        return productAttrDao.search(bo);
    }

    @Override
    public boolean update(AttrDO attr) {
        return productAttrDao.updateById(attr);
    }

    @Override
    public boolean delete(Long... ids) {
        return productAttrDao.removeByIds(Arrays.asList(ids));
    }
}